package com.shop2.dao.impl;

import java.sql.DriverManager;
import java.sql.SQLException;

import java.sql.Connection;


public class Dbutil {

	public static Connection creatconn() {
		java.sql.Connection conn = null;
		String url = "jdbc:mysql://localhost:3306/shopdb?useUnicode=true&characterEncoding=utf-8";
		String uid = "root";
		String pwd ="123456";
		String classname = "com.mysql.jdbc.Driver";
		
		try {
			Class.forName(classname);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			conn =  DriverManager.getConnection(url, uid, pwd);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return conn;
		
	}
}
